package com.example.text.helper
//
//
//
//import android.os.Bundle
//import android.view.Gravity
//import android.view.LayoutInflater
//import android.view.View
//import android.view.ViewGroup
//import androidx.fragment.app.DialogFragment
//import androidx.fragment.app.FragmentManager
//import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
//import com.example.text.R
//
////import com.jczy.cyclone.R
////import com.jczy.cyclone.adapter.CommonVDBRecyclerAdapter
////import com.jczy.cyclone.databinding.DialogMallGoodsAttributeBinding
////import com.jczy.cyclone.databinding.ItemMallGoodsAttributeRowBinding
////import com.jczy.cyclone.model.MallDetailInfoRow
//
///**
// * Created by ZengCS on 2022/8/15.
// * E-mail:zengcs@vip.qq.com
// * Add:中国成都
// * Desc: 商品参数
// */
//class BottomGoodsAttributesDialog : DialogFragment() {
//    companion object {
//        private val TAG: String = BottomGoodsAttributesDialog::class.java.simpleName
//    }
//
//    private var mAdapter: CommonVDBRecyclerAdapter<MallDetailInfoRow, ItemMallGoodsAttributeRowBinding>? = null
//    private val mItems: ArrayList<MallDetailInfoRow> = ArrayList()
//
//    override fun onCreate(savedInstanceState: Bundle?) {
//        super.onCreate(savedInstanceState)
//        setStyle(STYLE_NO_TITLE, R.style.BottomSheetDialog)
//        isCancelable = true
//    }
//
//    fun bindItems(list: List<MallDetailInfoRow>) {
//        mItems.clear()
//        mItems.addAll(list)
//    }
//
//    override fun onStart() {
//        super.onStart()
//        val window = dialog!!.window
//        val wlp = window!!.attributes
//        wlp.gravity = Gravity.BOTTOM
//        wlp.width = ViewGroup.LayoutParams.MATCH_PARENT
//        window.attributes = wlp
//    }
//
//    private lateinit var binding: DialogMallGoodsAttributeBinding
//
//    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
//        binding = DialogMallGoodsAttributeBinding.inflate(inflater)
//        return binding.root
//    }
//
//    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
//        binding.ivClose.setOnClickListener { dismiss() }
//        binding.btnComplete.setOnClickListener { dismiss() }
//        initAdapter()
//    }
//
//    private fun initAdapter() {
//        if (mAdapter == null) {
//            mAdapter = object : CommonVDBRecyclerAdapter<MallDetailInfoRow, ItemMallGoodsAttributeRowBinding>(R.layout.item_mall_goods_attribute_row, mItems) {
//                override fun convert(holder: BaseDataBindingHolder<ItemMallGoodsAttributeRowBinding>, item: MallDetailInfoRow) {
//                    holder.dataBinding?.item = item
//                    holder.dataBinding?.executePendingBindings()
//                }
//            }
//        } else {
//            mAdapter?.notifyDataSetChanged()
//        }
//        binding.rvCommon.adapter = mAdapter
//    }
//
//    fun show(fragmentManager: FragmentManager) {
//        if (fragmentManager.findFragmentByTag(TAG)?.isVisible == true) {
//            return
//        }
//        super.show(fragmentManager, TAG)
//    }
//}